package backstage.member.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import backstage.member.dao.MemberDao;
import backstage.member.pojo.Member;

public class MemberDaoImpl extends HibernateDaoSupport implements MemberDao {
	
	public void seva(Member c) {
		getHibernateTemplate().save(c);
	}

	public void update(Member c) {
		getHibernateTemplate().update(c);
	}

	public void delete(Member c) {
		getHibernateTemplate().delete(c);
	}

	public Member getMember(Integer id) {
		List<Member> list = getHibernateTemplate().find("from Member where id=?",id);
		if(list != null){
			return list.get(0);
		}else{
			return null;
		}
	}
	
	public List<Member> getMemberList(String hql, Object[] values) {
		List<Member> list = getHibernateTemplate().find(hql,values);
		return list;
	}
}
